<script lang="ts" setup>

const clickHandler = () => {
  console.log('点击成功')
}

const onMouseEnter = () => {
  console.log('鼠标进入')
}

const onMouseLeave = () => {
  console.log('鼠标离开')
}

</script>

<template>
   <button @click="clickHandler">点</button>
   <div class="box" @mouseenter="onMouseEnter" @mouseleave="onMouseLeave">鼠标移入移出</div>
</template>

<style scoped>
.box{
  width: 200px;
  height: 200px;
  background-color: #f00;
}
</style>